$(function() {
//	uploadify();
//	userFilesSubmit();
	userHomeMenuInit();
});

userHomeMenuInit = function() {
	$('#'+$('#userHomeHistory').val()).show();
	$('#'+$('#userHomeHistoryItem').val()).addClass('action');
	
	$('#accordion h4').click(function() {
		  var thisClick = $(this).attr('class');
		  $.each($('#accordion h4'), function(i, o) {
			 if($(o).attr('class') != thisClick) {
				 $('#'+$(o).attr('class')).hide(100);
			 } 
		  });
		  $('#'+thisClick).show(200);
		  removeCalss();
	});
	
	$('.accordionItem').click(function() {
		removeCalss();
		var userHomeHistory = $(this).parents('ul').parents('div').attr('id');
		var userHomeHistoryItem = $(this).attr('id');
		$('#userHomeHistory').val(userHomeHistory);
		$('#userHomeHistoryItem').val(userHomeHistoryItem);
		var url = $(this).find('a').attr('rel');
		location.href = url+'?param.userHomeHistory='+userHomeHistory+'&param.userHomeHistoryItem='+userHomeHistoryItem;
	});
};

removeCalss  = function() {
	$.each($('.accordionItem'), function(i, o) {
		  $(o).removeClass('action');
	});
};